using CoreManager.Models.DTOs;

namespace CoreManager.Services.Auth
{
    /// <summary>
    /// JWT服务接口
    /// </summary>
    public interface IJwtService
    {
        /// <summary>
        /// 生成访问令牌
        /// </summary>
        /// <param name="userInfo"></param>
        /// <returns></returns>
        string GenerateAccessToken(UserInfoDto userInfo);

        /// <summary>
        /// 生成刷新令牌
        /// </summary>
        /// <returns></returns>
        string GenerateRefreshToken();

        /// <summary>
        /// 验证令牌
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        bool ValidateToken(string token);

        /// <summary>
        /// 从令牌获取用户信息
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        UserInfoDto? GetUserInfoFromToken(string token);
    }
}